<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let p = new Promise((res,rej)=>{
        //     // res('ok')
        //     rej('错了')
        // })

        // let p2 = p.then((val)=>{
        //     console.log(val);
        //     // return Promise.reject('ok')
        //     // return 123;
        //     return new Promise((res,rej)=>{
        //         rej('err')
        //     })
        // },rea=>{
        //     console.log(rea);
            
        // })

        // console.log(p2);

        // let p = Promise.resolve('ok');
        // let p = Promise.resolve(function(){});
        // let p = Promise.resolve(new Promise((res,rej)=>{
        //     // return Promise.resolve();
        //     res()
        // }));

        // let p = Promise.resolve(Promise.resolve(Promise.resolve(new Promise((res)=>{res(123)}))))
        let p = Promise.resolve(Promise.reject(Promise.resolve(new Promise((res)=>{res(123)}))))

        console.log(p);

    </script>
</body>
</html>